package s13.ch15.ex3;

import java.util.ArrayList;
import java.util.List;
import s13.ch15.ex2.model.*;

public class MyList {

	public static void main(String[] args) {
		List<Car> cars = new ArrayList();
		cars.add(new Car());
		cars.add(new Car());
		Car car2 = new Car();
		cars.add(car2);
		cars.add(new Car());
		for (Car car : cars) {
			System.out.println(car);
		}
		System.out.println(cars.get(2));
		System.out.println(cars.indexOf(car2));
		System.out.println(cars.contains(car2));
		cars.set(2, new Car());
		System.out.println(cars.contains(car2));
	}

}
